home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / Advanced Typewriter Scroll Java Applet Comm. v1.0 / advtypew2.exe / example2 / advtypew.class (.txt) next >
Encoding:
Java Class File  |  2001-03-10  |  15.4 KB  |  846 lines

  1. import java.applet.Applet;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Event;
  5. import java.awt.Font;
  6. import java.awt.FontMetrics;
  7. import java.awt.Graphics;
  8. import java.awt.Image;
  9. import java.awt.MediaTracker;
  10. import java.io.DataInputStream;
  11. import java.net.URL;
  12. import java.net.URLConnection;
  13. import java.util.Enumeration;
  14. import java.util.StringTokenizer;
  15. import java.util.Vector;
  16.  
  17. public class advtypew extends Applet implements Runnable {
  18.    Thread runner;
  19.    // $FF: renamed from: w int
  20.    int field_0;
  21.    // $FF: renamed from: h int
  22.    int field_1;
  23.    int scroll_delay;
  24.    int border_thickness;
  25.    // $FF: renamed from: i int
  26.    int field_2;
  27.    int num;
  28.    int left_margin;
  29.    int top_margin;
  30.    int right_margin;
  31.    int bottom_margin;
  32.    // $FF: renamed from: a int
  33.    int field_3;
  34.    // $FF: renamed from: b int
  35.    int field_4;
  36.    // $FF: renamed from: c int
  37.    int field_5;
  38.    // $FF: renamed from: j int
  39.    int field_6;
  40.    int bos;
  41.    int pspace;
  42.    int tmaxas;
  43.    int tmaxdes;
  44.    int maxas;
  45.    int maxdes;
  46.    int yspace_text;
  47.    int yspace_title;
  48.    int durum;
  49.    String kelime = "";
  50.    String bgstr = "";
  51.    String regcode = "";
  52.    String infostr = "";
  53.    Color bgc;
  54.    Color titlec;
  55.    Color textc;
  56.    Color htitlec;
  57.    Color htextc;
  58.    Color borderc;
  59.    Color curtitlec;
  60.    Color curtextc;
  61.    String title_align = "";
  62.    String text_align = "";
  63.    // $FF: renamed from: ft java.lang.String
  64.    String field_7 = "";
  65.    // $FF: renamed from: bs java.lang.String
  66.    String field_8 = "";
  67.    String bs2 = "";
  68.    String bosluk = " ";
  69.    String input_text = "";
  70.    String text_file = "";
  71.    String unrega = " Unregistered Advanced Typewriter Scroll Java applet. http://japplets.tripod.com/";
  72.    Font tnf;
  73.    // $FF: renamed from: nf java.awt.Font
  74.    Font field_9;
  75.    FontMetrics tfmetrics;
  76.    FontMetrics fmetrics;
  77.    String[] str;
  78.    String[] links;
  79.    String[] stb;
  80.    String[] tit;
  81.    String[] target_frame;
  82.    int[] dur;
  83.    int[] satirsayh;
  84.    String[][] satirh;
  85.    int[] satirsay;
  86.    String[][] satir;
  87.    StringTokenizer st1;
  88.    StringTokenizer st2;
  89.    StringTokenizer st3;
  90.    // $FF: renamed from: vi int
  91.    int field_10;
  92.    int image_xposition;
  93.    int image_yposition;
  94.    int[][][] xht;
  95.    int[][][] yht;
  96.    int[] ysize;
  97.    int[] ptop;
  98.    int[] pbot;
  99.    int[] pmode;
  100.    // $FF: renamed from: Y int
  101.    int field_11;
  102.    int sdly;
  103.    // $FF: renamed from: m int
  104.    int field_12;
  105.    int linew;
  106.    // $FF: renamed from: cx int
  107.    int field_13;
  108.    // $FF: renamed from: cy int
  109.    int field_14;
  110.    // $FF: renamed from: n int
  111.    int field_15;
  112.    // $FF: renamed from: p int
  113.    int field_16;
  114.    // $FF: renamed from: hp int
  115.    int field_17 = -1;
  116.    int ilk;
  117.    // $FF: renamed from: rg boolean
  118.    boolean field_18 = false;
  119.    boolean bfile = false;
  120.    boolean bgbool = false;
  121.    boolean stbstatus = false;
  122.    boolean whb = false;
  123.    Image offimg;
  124.    Image offimg2;
  125.    Image offimg3;
  126.    Image bgimage;
  127.    Image bosimg;
  128.    Graphics offg;
  129.    Graphics offg2;
  130.    Graphics offg3;
  131.    // $FF: renamed from: u java.net.URL
  132.    URL field_19;
  133.    Vector vect;
  134.    int bdes;
  135.    int tpy;
  136.    int type_delay;
  137.    int csat;
  138.    int cpar;
  139.    int satpar;
  140.    int cchar;
  141.    int anims;
  142.    char[] harfler;
  143.    String cstr = "";
  144.  
  145.    public void init() {
  146.       ((Component)this).setBackground(Color.white);
  147.       this.whb = false;
  148.       this.ilk = 0;
  149.       this.field_17 = -1;
  150.       this.field_14 = -1000;
  151.       this.vect = new Vector();
  152.       this.regcode = ((Applet)this).getParameter("regcode");
  153.       if (this.regcode != null && (this.regcode.equals("typ5834ws") || this.regcode.equals("coghkr5u8"))) {
  154.          this.field_18 = true;
  155.       }
  156.  
  157.       this.infostr = ((Applet)this).getParameter("info");
  158.       if (!this.infostr.equals("Applet by Gokhan Dagli,japplets.tripod.com")) {
  159.          this.durum = 1;
  160.       }
  161.  
  162.       this.bgc = new Color(this.method_0("bgcolor", 16, 16777215));
  163.       this.titlec = new Color(this.method_0("title_color", 16, 0));
  164.       this.textc = new Color(this.method_0("text_color", 16, 0));
  165.       this.htitlec = new Color(this.method_0("highlight_title_color", 16, 0));
  166.       this.htextc = new Color(this.method_0("highlight_text_color", 16, 0));
  167.       this.bgstr = ((Applet)this).getParameter("bgimage");
  168.       if (this.bgstr == null) {
  169.          this.bgbool = false;
  170.       } else if (this.bgstr.endsWith(".gif") || this.bgstr.endsWith(".GIF") || this.bgstr.endsWith(".jpg") || this.bgstr.endsWith(".JPG")) {
  171.          this.bgbool = true;
  172.       }
  173.  
  174.       ((Component)this).show();
  175.       if (this.bgbool) {
  176.          MediaTracker var1 = new MediaTracker(this);
  177.          this.bgimage = ((Applet)this).getImage(((Applet)this).getCodeBase(), "" + this.bgstr);
  178.          var1.addImage(this.bgimage, 1);
  179.  
  180.          try {
  181.             var1.waitForAll();
  182.          } catch (InterruptedException var5) {
  183.          }
  184.  
  185.          this.image_xposition = this.method_0("image_xposition", 10, 0);
  186.          this.image_yposition = this.method_0("image_yposition", 10, 0);
  187.       }
  188.  
  189.       this.title_align = this.stp("title_align", "left");
  190.       this.text_align = this.stp("text_align", "left");
  191.       this.field_7 = this.stp("title_font_type", "Arial");
  192.       this.tnf = new Font(this.field_7, this.method_0("title_font_style", 10, 1), this.method_0("title_font_size", 10, 12));
  193.       this.tfmetrics = ((Component)this).getFontMetrics(this.tnf);
  194.       this.field_7 = this.stp("text_font_type", "Arial");
  195.       this.field_9 = new Font(this.field_7, this.method_0("text_font_style", 10, 1), this.method_0("text_font_size", 10, 12));
  196.       this.fmetrics = ((Component)this).getFontMetrics(this.field_9);
  197.       this.scroll_delay = this.method_0("scroll_delay", 10, 30);
  198.       this.type_delay = this.method_0("type_delay", 10, 30);
  199.       this.border_thickness = this.method_0("border_thickness", 10, 0);
  200.       this.borderc = new Color(this.method_0("border_color", 16, 0));
  201.       this.input_text = this.stp("input_text", "from_parameters");
  202.       this.text_file = this.stp("text_file", "input.txt");
  203.       if (this.input_text.equals("from_file")) {
  204.          this.bfile = true;
  205.       } else {
  206.          this.bfile = false;
  207.       }
  208.  
  209.       if (this.bfile) {
  210.          try {
  211.             URLConnection var2 = (new URL(((Applet)this).getCodeBase(), "" + this.text_file)).openConnection();
  212.             var2.setDoInput(true);
  213.             var2.setUseCaches(false);
  214.             DataInputStream var7 = new DataInputStream(var2.getInputStream());
  215.             this.field_2 = 1;
  216.  
  217.             while(true) {
  218.                this.field_8 = var7.readLine();
  219.                if (this.field_8 == null) {
  220.                   --this.field_2;
  221.                   if (this.field_2 < 0) {
  222.                      this.field_2 = 0;
  223.                   }
  224.                   break;
  225.                }
  226.  
  227.                if (this.field_8.trim().equals("") || this.field_8.length() <= 3) {
  228.                   --this.field_2;
  229.                   if (this.field_2 < 0) {
  230.                      this.field_2 = 0;
  231.                   }
  232.                   break;
  233.                }
  234.  
  235.                this.vect.addElement("" + this.field_8);
  236.                ++this.field_2;
  237.             }
  238.  
  239.             this.num = this.field_2;
  240.          } catch (Exception var6) {
  241.          }
  242.       } else {
  243.          this.field_2 = 1;
  244.  
  245.          while(true) {
  246.             this.field_8 = ((Applet)this).getParameter("text" + this.field_2);
  247.             this.bs2 = ((Applet)this).getParameter("title" + this.field_2);
  248.             if (this.field_8 == null && this.bs2 == null) {
  249.                --this.field_2;
  250.                if (this.field_2 < 0) {
  251.                   this.field_2 = 0;
  252.                }
  253.                break;
  254.             }
  255.  
  256.             if (this.field_8.trim().equals("") && this.bs2.trim().equals("")) {
  257.                --this.field_2;
  258.                if (this.field_2 < 0) {
  259.                   this.field_2 = 0;
  260.                }
  261.                break;
  262.             }
  263.  
  264.             ++this.field_2;
  265.          }
  266.  
  267.          this.num = this.field_2;
  268.       }
  269.  
  270.       this.str = new String[this.num + 1];
  271.       this.links = new String[this.num + 1];
  272.       this.stb = new String[this.num + 1];
  273.       this.tit = new String[this.num + 1];
  274.       this.dur = new int[this.num + 1];
  275.       this.target_frame = new String[this.num + 1];
  276.       this.satirsayh = new int[this.num + 1];
  277.       this.satirh = new String[this.num + 1][101];
  278.       this.satir = new String[this.num + 1][101];
  279.       this.satirsay = new int[this.num + 1];
  280.       this.xht = new int[2][this.num + 1][101];
  281.       this.yht = new int[2][this.num + 1][101];
  282.       this.ysize = new int[this.num + 1];
  283.       this.ptop = new int[this.num + 1];
  284.       this.pbot = new int[this.num + 1];
  285.       this.pmode = new int[this.num + 1];
  286.       this.harfler = new char[300];
  287.       this.field_6 = 1;
  288.       if (this.bfile) {
  289.          Enumeration var8 = this.vect.elements();
  290.  
  291.          for(String var9 = ""; var8.hasMoreElements(); ++this.field_6) {
  292.             var9 = (String)var8.nextElement();
  293.             StringTokenizer var3 = new StringTokenizer(var9, "|", true);
  294.             int var4 = 0;
  295.  
  296.             while(var3.hasMoreTokens()) {
  297.                this.field_8 = var3.nextToken();
  298.                if (this.field_8.equals("|")) {
  299.                   ++var4;
  300.                } else {
  301.                   if (var4 == 0) {
  302.                      this.tit[this.field_6] = this.field_8;
  303.                   }
  304.  
  305.                   if (var4 == 1) {
  306.                      this.str[this.field_6] = this.field_8;
  307.                   }
  308.  
  309.                   if (var4 == 2) {
  310.                      this.links[this.field_6] = this.field_8;
  311.                   }
  312.  
  313.                   if (var4 == 3) {
  314.                      this.target_frame[this.field_6] = this.field_8;
  315.                   }
  316.                }
  317.             }
  318.          }
  319.       }
  320.  
  321.       for(this.field_2 = 1; this.field_2 <= this.num; ++this.field_2) {
  322.          if (!this.bfile) {
  323.             this.str[this.field_2] = ((Applet)this).getParameter("text" + this.field_2);
  324.             this.tit[this.field_2] = ((Applet)this).getParameter("title" + this.field_2);
  325.             this.links[this.field_2] = ((Applet)this).getParameter("link" + this.field_2);
  326.             this.target_frame[this.field_2] = ((Applet)this).getParameter("target_frame" + this.field_2);
  327.          }
  328.  
  329.          if (this.str[this.field_2] == null) {
  330.             this.str[this.field_2] = "";
  331.          }
  332.  
  333.          if (this.tit[this.field_2] == null) {
  334.             this.tit[this.field_2] = "";
  335.          }
  336.  
  337.          if (this.links[this.field_2] == null) {
  338.             this.links[this.field_2] = "";
  339.          }
  340.  
  341.          if (this.target_frame[this.field_2] == null) {
  342.             this.target_frame[this.field_2] = "_self";
  343.          }
  344.  
  345.          if (this.links[this.field_2] == null) {
  346.             this.links[this.field_6] = "";
  347.             this.dur[this.field_2] = 0;
  348.          } else {
  349.             this.dur[this.field_2] = 1;
  350.             if (this.links[this.field_2].trim().equals("")) {
  351.                this.dur[this.field_2] = 0;
  352.             }
  353.          }
  354.  
  355.          if (this.dur[this.field_2] == 0) {
  356.             this.stb[this.field_2] = "";
  357.          } else {
  358.             if (this.target_frame[this.field_2] == null) {
  359.                this.target_frame[this.field_2] = "_self";
  360.             } else if (this.target_frame[this.field_2].trim().equals("")) {
  361.                this.target_frame[this.field_2] = "_self";
  362.             }
  363.  
  364.             if (this.links[this.field_2].startsWith("http://")) {
  365.                this.stb[this.field_2] = this.links[this.field_2];
  366.             } else {
  367.                this.stb[this.field_2] = "" + ((Applet)this).getCodeBase() + "" + this.links[this.field_2];
  368.             }
  369.          }
  370.       }
  371.  
  372.       this.tmaxas = this.tfmetrics.getAscent();
  373.       this.tmaxdes = this.tfmetrics.getDescent();
  374.       this.maxas = this.fmetrics.getAscent();
  375.       this.maxdes = this.fmetrics.getDescent();
  376.       this.bdes = Math.max(this.tmaxdes, this.maxdes);
  377.       this.left_margin = this.method_0("left_margin", 10, 0);
  378.       this.top_margin = this.method_0("top_margin", 10, 0);
  379.       this.right_margin = this.method_0("right_margin", 10, 0);
  380.       this.bottom_margin = this.method_0("bottom_margin", 10, 0);
  381.       this.yspace_title = this.method_0("title_linespace", 10, 0);
  382.       this.yspace_text = this.method_0("text_linespace", 10, 0);
  383.       this.pspace = this.method_0("vertical_space", 10, 20);
  384.    }
  385.  
  386.    // $FF: renamed from: fi (java.lang.String, int, int) int
  387.    public int method_0(String var1, int var2, int var3) {
  388.       int var4 = 0;
  389.       var1 = ((Applet)this).getParameter("" + var1);
  390.       if (var1 == null) {
  391.          return var3;
  392.       } else {
  393.          try {
  394.             var4 = Integer.parseInt(var1, var2);
  395.          } catch (Exception var5) {
  396.             var4 = var3;
  397.          }
  398.  
  399.          return var4;
  400.       }
  401.    }
  402.  
  403.    public String stp(String var1, String var2) {
  404.       var1 = ((Applet)this).getParameter("" + var1);
  405.       return var1 == null ? var2 : var1;
  406.    }
  407.  
  408.    public void typer() {
  409.       String var1 = "";
  410.       this.ptop[this.field_2] = this.field_10;
  411.  
  412.       for(this.field_6 = 1; this.field_6 <= this.satirsayh[this.field_2]; ++this.field_6) {
  413.          int var2 = this.left_margin;
  414.          var1 = this.satirh[this.field_2][this.field_6];
  415.          this.field_10 += this.tmaxas;
  416.          int var3 = this.tfmetrics.stringWidth(var1);
  417.          if (this.title_align.equals("center")) {
  418.             var2 = (this.field_0 - this.left_margin - this.right_margin - var3) / 2 + this.left_margin;
  419.          }
  420.  
  421.          if (this.title_align.equals("right")) {
  422.             var2 = this.field_0 - var3;
  423.          }
  424.  
  425.          this.xht[1][this.field_2][this.field_6] = var2;
  426.          this.yht[1][this.field_2][this.field_6] = this.field_10;
  427.          if (this.ilk == 0) {
  428.             this.ilk = this.field_10;
  429.          }
  430.  
  431.          this.field_10 = this.field_10 + this.tmaxdes + this.yspace_title;
  432.       }
  433.  
  434.       for(this.field_6 = 1; this.field_6 <= this.satirsay[this.field_2]; ++this.field_6) {
  435.          int var6 = this.left_margin;
  436.          var1 = this.satir[this.field_2][this.field_6];
  437.          this.field_10 += this.maxas;
  438.          int var7 = this.fmetrics.stringWidth(var1);
  439.          if (this.text_align.equals("center")) {
  440.             var6 = (this.field_0 - this.left_margin - this.right_margin - var7) / 2 + this.left_margin;
  441.          }
  442.  
  443.          if (this.text_align.equals("right")) {
  444.             var6 = this.field_0 - var7;
  445.          }
  446.  
  447.          if (this.durum == 1) {
  448.             this.satir[this.field_2][this.field_6] = "info parameter error!";
  449.          }
  450.  
  451.          this.xht[0][this.field_2][this.field_6] = var6;
  452.          this.yht[0][this.field_2][this.field_6] = this.field_10;
  453.          if (this.ilk == 0) {
  454.             this.ilk = this.field_10;
  455.          }
  456.  
  457.          this.field_10 = this.field_10 + this.maxdes + this.yspace_text;
  458.       }
  459.  
  460.       this.pbot[this.field_2] = this.field_10;
  461.       this.field_10 += this.pspace;
  462.    }
  463.  
  464.    public void update(Graphics var1) {
  465.       if (this.whb) {
  466.          this.offg2.drawImage(this.bosimg, 0, 0, this);
  467.  
  468.          for(this.field_2 = 1; this.field_2 <= this.num; ++this.field_2) {
  469.             for(this.field_6 = 1; this.field_6 <= this.satirsayh[this.field_2]; ++this.field_6) {
  470.                if (this.satpar != 0 || this.field_6 != this.csat || this.field_2 != this.cpar) {
  471.                   this.offg2.setFont(this.tnf);
  472.                   if (this.field_2 == this.field_17 && this.dur[this.field_2] == 1) {
  473.                      this.curtitlec = this.htitlec;
  474.                   } else {
  475.                      this.curtitlec = this.titlec;
  476.                   }
  477.  
  478.                   this.offg2.setColor(this.curtitlec);
  479.                   if (this.yht[1][this.field_2][this.field_6] + this.field_11 + this.tmaxdes >= 0 && this.yht[1][this.field_2][this.field_6] + this.field_11 - this.tmaxas < this.field_1) {
  480.                      this.offg2.drawString(this.satirh[this.field_2][this.field_6], 0, this.field_11 + this.yht[1][this.field_2][this.field_6]);
  481.                   }
  482.                }
  483.             }
  484.  
  485.             for(this.field_6 = 1; this.field_6 <= this.satirsay[this.field_2]; ++this.field_6) {
  486.                if (this.satpar != 1 || this.field_6 != this.csat || this.field_2 != this.cpar) {
  487.                   this.offg2.setFont(this.field_9);
  488.                   if (this.field_2 == this.field_17 && this.dur[this.field_2] == 1) {
  489.                      this.curtextc = this.htextc;
  490.                   } else {
  491.                      this.curtextc = this.textc;
  492.                   }
  493.  
  494.                   this.offg2.setColor(this.curtextc);
  495.                   if (this.yht[0][this.field_2][this.field_6] + this.field_11 + this.maxdes >= 0 && this.yht[0][this.field_2][this.field_6] + this.field_11 - this.maxas < this.field_1) {
  496.                      this.offg2.drawString(this.satir[this.field_2][this.field_6], 0, this.field_11 + this.yht[0][this.field_2][this.field_6]);
  497.                   }
  498.                }
  499.             }
  500.          }
  501.  
  502.          if (this.anims == 0) {
  503.             if (this.satpar == 0) {
  504.                this.offg2.setFont(this.tnf);
  505.                if (this.cpar == this.field_17 && this.dur[this.field_17] == 1) {
  506.                   this.curtitlec = this.htitlec;
  507.                } else {
  508.                   this.curtitlec = this.titlec;
  509.                }
  510.  
  511.                this.offg2.setColor(this.curtitlec);
  512.             } else {
  513.                this.offg2.setFont(this.field_9);
  514.                if (this.cpar == this.field_17 && this.dur[this.field_17] == 1) {
  515.                   this.curtextc = this.htextc;
  516.                } else {
  517.                   this.curtextc = this.textc;
  518.                }
  519.  
  520.                this.offg2.setColor(this.curtextc);
  521.             }
  522.  
  523.             this.offg2.drawChars(this.harfler, 0, this.cchar, 0, this.tpy);
  524.          }
  525.  
  526.          this.offg.drawImage(this.offimg2, this.left_margin, this.top_margin, this);
  527.          this.paint(var1);
  528.       }
  529.  
  530.    }
  531.  
  532.    public void paint(Graphics var1) {
  533.       if (this.whb) {
  534.          var1.drawImage(this.offimg, 0, 0, this);
  535.       }
  536.  
  537.    }
  538.  
  539.    public boolean mouseExit(Event var1, int var2, int var3) {
  540.       if (this.whb) {
  541.          this.field_13 = -1;
  542.          this.field_14 = -1000;
  543.          this.field_17 = -1;
  544.          ((Applet)this).showStatus("");
  545.          ((Component)this).repaint();
  546.       }
  547.  
  548.       return true;
  549.    }
  550.  
  551.    public boolean mouseMove(Event var1, int var2, int var3) {
  552.       if (this.whb) {
  553.          this.field_13 = var2;
  554.          this.field_14 = var3;
  555.          this.field_17 = -1;
  556.  
  557.          for(this.field_16 = 1; this.field_16 <= this.num; ++this.field_16) {
  558.             if (this.field_11 + this.ptop[this.field_16] + this.top_margin <= this.field_14 && this.field_11 + this.pbot[this.field_16] + this.top_margin >= this.field_14) {
  559.                this.field_17 = this.field_16;
  560.             }
  561.          }
  562.  
  563.          if (this.field_17 != -1) {
  564.             if (this.dur[this.field_17] == 1 && !this.stbstatus) {
  565.                ((Applet)this).showStatus("" + this.stb[this.field_17]);
  566.                this.stbstatus = true;
  567.             }
  568.          } else if (this.stbstatus) {
  569.             if (this.field_18) {
  570.                ((Applet)this).showStatus("");
  571.             } else {
  572.                ((Applet)this).showStatus("" + this.unrega);
  573.             }
  574.  
  575.             this.stbstatus = false;
  576.          }
  577.  
  578.          ((Component)this).repaint();
  579.       }
  580.  
  581.       return true;
  582.    }
  583.  
  584.    public boolean mouseUp(Event var1, int var2, int var3) {
  585.       if (this.whb) {
  586.          if (this.field_17 == -1) {
  587.             return true;
  588.          }
  589.  
  590.          if (this.dur[this.field_17] == 0) {
  591.             return true;
  592.          }
  593.  
  594.          try {
  595.             if (this.links[this.field_17].startsWith("http://")) {
  596.                this.field_19 = new URL("" + this.links[this.field_17]);
  597.             } else {
  598.                this.field_19 = new URL(((Applet)this).getCodeBase(), "" + this.links[this.field_17]);
  599.             }
  600.          } catch (Exception var4) {
  601.             return true;
  602.          }
  603.  
  604.          ((Applet)this).getAppletContext().showDocument(this.field_19, this.target_frame[this.field_17]);
  605.       }
  606.  
  607.       return true;
  608.    }
  609.  
  610.    public void start() {
  611.       if (this.runner == null) {
  612.          this.runner = new Thread(this);
  613.          this.runner.start();
  614.       } else {
  615.          this.runner.resume();
  616.       }
  617.    }
  618.  
  619.    public void stop() {
  620.       if (this.runner != null) {
  621.          this.runner.stop();
  622.          this.runner = null;
  623.       }
  624.  
  625.    }
  626.  
  627.    public void destroy() {
  628.       this.runner = null;
  629.    }
  630.  
  631.    public void run() {
  632.       ((Component)this).show();
  633.       this.field_0 = ((Component)this).size().width;
  634.       this.field_1 = ((Component)this).size().height;
  635.       if (!this.whb) {
  636.          this.field_11 = this.tpy;
  637.  
  638.          for(this.field_2 = 1; this.field_2 <= this.num; ++this.field_2) {
  639.             this.field_3 = 1;
  640.             this.field_4 = 0;
  641.             this.field_5 = this.field_0 - this.left_margin - this.right_margin;
  642.             this.st3 = new StringTokenizer(this.tit[this.field_2], "#");
  643.             this.field_6 = 1;
  644.             this.bos = this.tfmetrics.stringWidth(this.bosluk);
  645.             this.satirh[this.field_2][1] = "";
  646.  
  647.             while(this.st3.hasMoreTokens()) {
  648.                this.field_8 = this.st3.nextToken();
  649.  
  650.                for(this.st2 = new StringTokenizer(this.field_8, " "); this.st2.hasMoreTokens(); ++this.field_6) {
  651.                   this.kelime = this.st2.nextToken();
  652.                   if (this.tfmetrics.stringWidth(this.satirh[this.field_2][this.field_3]) + this.tfmetrics.stringWidth(this.kelime) + this.bos <= this.field_5) {
  653.                      this.satirh[this.field_2][this.field_3] = this.satirh[this.field_2][this.field_3] + this.kelime + " ";
  654.                   } else {
  655.                      ++this.field_3;
  656.                      this.satirh[this.field_2][this.field_3] = "";
  657.                      this.satirh[this.field_2][this.field_3] = this.satirh[this.field_2][this.field_3] + this.kelime + " ";
  658.                   }
  659.                }
  660.  
  661.                if (!this.field_8.trim().equals("") || !this.tit[this.field_2].trim().equals("")) {
  662.                   ++this.field_3;
  663.                   this.satirh[this.field_2][this.field_3] = "";
  664.                }
  665.             }
  666.  
  667.             this.satirsayh[this.field_2] = this.field_3 - 1;
  668.             this.field_3 = 1;
  669.             this.field_4 = 0;
  670.             this.st3 = new StringTokenizer(this.str[this.field_2], "#");
  671.             this.field_6 = 1;
  672.             this.bos = this.fmetrics.stringWidth(this.bosluk);
  673.             this.satir[this.field_2][1] = "";
  674.  
  675.             while(this.st3.hasMoreTokens()) {
  676.                this.field_8 = this.st3.nextToken();
  677.  
  678.                for(this.st2 = new StringTokenizer(this.field_8, " "); this.st2.hasMoreTokens(); ++this.field_6) {
  679.                   this.kelime = this.st2.nextToken();
  680.                   if (this.fmetrics.stringWidth(this.satir[this.field_2][this.field_3]) + this.fmetrics.stringWidth(this.kelime) + this.bos <= this.field_5) {
  681.                      this.satir[this.field_2][this.field_3] = this.satir[this.field_2][this.field_3] + this.kelime + " ";
  682.                   } else {
  683.                      ++this.field_3;
  684.                      this.satir[this.field_2][this.field_3] = "";
  685.                      this.satir[this.field_2][this.field_3] = this.satir[this.field_2][this.field_3] + this.kelime + " ";
  686.                   }
  687.                }
  688.  
  689.                if (!this.field_8.trim().equals("") || !this.str[this.field_2].trim().equals("")) {
  690.                   ++this.field_3;
  691.                   this.satir[this.field_2][this.field_3] = "";
  692.                }
  693.             }
  694.  
  695.             this.satirsay[this.field_2] = this.field_3 - 1;
  696.             this.ysize[this.field_2] = this.satirsay[this.field_2] * (this.tmaxas + this.tmaxdes) + (this.satirsay[this.field_2] - 1) * this.yspace_text + this.satirsayh[this.field_2] * (this.maxas + this.maxdes) + this.satirsayh[this.field_2] * this.yspace_title;
  697.          }
  698.  
  699.          this.field_10 = 0;
  700.  
  701.          for(this.field_2 = 1; this.field_2 <= this.num; ++this.field_2) {
  702.             this.typer();
  703.          }
  704.  
  705.          this.sdly = this.scroll_delay;
  706.          this.offimg = ((Component)this).createImage(this.field_0, this.field_1);
  707.          this.offg = this.offimg.getGraphics();
  708.          this.offg.clipRect(0, 0, this.field_0, this.field_1);
  709.          this.offimg2 = ((Component)this).createImage(this.field_0 - this.left_margin - this.right_margin, this.field_1 - this.top_margin - this.bottom_margin);
  710.          this.offg2 = this.offimg2.getGraphics();
  711.          this.offg2.clipRect(0, 0, this.field_0 - this.left_margin - this.right_margin, this.field_1 - this.top_margin - this.bottom_margin);
  712.          this.offg.setColor(this.bgc);
  713.          this.offg.fillRect(0, 0, this.field_0, this.field_1);
  714.          if (this.bgbool) {
  715.             this.offg.drawImage(this.bgimage, this.image_xposition, this.image_yposition, this);
  716.          }
  717.  
  718.          this.offg2.drawImage(this.offimg, -1 * this.left_margin, -1 * this.top_margin, this);
  719.          this.bosimg = ((Component)this).createImage(this.offimg2.getSource());
  720.          if (this.border_thickness > 0) {
  721.             this.offg.setColor(this.borderc);
  722.  
  723.             for(this.field_12 = 1; this.field_12 <= this.border_thickness; ++this.field_12) {
  724.                this.offg.drawRect(this.field_12 - 1, this.field_12 - 1, this.field_0 - 2 * this.field_12 + 1, this.field_1 - 2 * this.field_12 + 1);
  725.             }
  726.          }
  727.  
  728.          this.offg.clipRect(this.border_thickness, this.border_thickness, this.field_0 - 2 * this.border_thickness, this.field_1 - 2 * this.border_thickness);
  729.          System.gc();
  730.       }
  731.  
  732.       this.whb = true;
  733.       this.field_17 = -1;
  734.       this.field_14 = -1000;
  735.       this.sdly = this.type_delay;
  736.       this.csat = 1;
  737.       this.cpar = 1;
  738.       this.satpar = 0;
  739.       this.cchar = 0;
  740.       this.anims = 0;
  741.       this.tpy = this.field_1 - this.bottom_margin - this.top_margin - this.bdes;
  742.       this.field_11 = this.tpy - this.ilk;
  743.  
  744.       while(true) {
  745.          if (this.satpar == 0) {
  746.             if (this.satirsayh[this.cpar] <= 0) {
  747.                this.satpar = 1;
  748.                this.csat = 1;
  749.                continue;
  750.             }
  751.          } else if (this.satirsay[this.cpar] <= 0) {
  752.             this.satpar = 0;
  753.             ++this.cpar;
  754.             this.csat = 1;
  755.             if (this.cpar > this.num) {
  756.                this.cpar = 1;
  757.             }
  758.             continue;
  759.          }
  760.  
  761.          if (this.anims == 0) {
  762.             this.sdly = this.type_delay;
  763.             ++this.cchar;
  764.             if (this.satpar == 0) {
  765.                if (this.cchar > this.satirh[this.cpar][this.csat].length()) {
  766.                   this.cchar = 0;
  767.                   ++this.csat;
  768.                   if (this.csat > this.satirsayh[this.cpar]) {
  769.                      this.csat = 1;
  770.                      this.satpar = 1;
  771.                   }
  772.  
  773.                   this.anims = 1;
  774.                }
  775.  
  776.                this.cstr = this.satirh[this.cpar][this.csat];
  777.             } else {
  778.                if (this.cchar > this.satir[this.cpar][this.csat].length()) {
  779.                   this.cchar = 0;
  780.                   ++this.csat;
  781.                   if (this.csat > this.satirsay[this.cpar]) {
  782.                      this.csat = 1;
  783.                      this.satpar = 0;
  784.                      ++this.cpar;
  785.                      if (this.cpar > this.num) {
  786.                         this.cpar = 1;
  787.                      }
  788.                   }
  789.  
  790.                   this.anims = 1;
  791.                }
  792.  
  793.                this.cstr = this.satir[this.cpar][this.csat];
  794.             }
  795.  
  796.             this.harfler = this.cstr.toCharArray();
  797.          } else {
  798.             this.sdly = this.scroll_delay;
  799.             --this.field_11;
  800.             if (this.field_11 < -this.field_10) {
  801.                this.field_11 = this.tpy - this.ilk;
  802.                this.anims = 0;
  803.             }
  804.  
  805.             if (this.satpar == 0) {
  806.                if (this.field_11 + this.yht[1][this.cpar][this.csat] == this.tpy) {
  807.                   this.anims = 0;
  808.                }
  809.             } else if (this.field_11 + this.yht[0][this.cpar][this.csat] == this.tpy) {
  810.                this.anims = 0;
  811.             }
  812.          }
  813.  
  814.          this.field_17 = -1;
  815.  
  816.          for(this.field_16 = 1; this.field_16 <= this.num; ++this.field_16) {
  817.             if (this.field_11 + this.ptop[this.field_16] + this.top_margin <= this.field_14 && this.field_11 + this.pbot[this.field_16] + this.top_margin >= this.field_14) {
  818.                this.field_17 = this.field_16;
  819.             }
  820.          }
  821.  
  822.          if (this.field_17 != -1) {
  823.             if (this.dur[this.field_17] == 1 && !this.stbstatus) {
  824.                ((Applet)this).showStatus("" + this.stb[this.field_17]);
  825.                this.stbstatus = true;
  826.             }
  827.          } else if (this.stbstatus) {
  828.             if (this.field_18) {
  829.                ((Applet)this).showStatus("");
  830.             } else {
  831.                ((Applet)this).showStatus("" + this.unrega);
  832.             }
  833.  
  834.             this.stbstatus = false;
  835.          }
  836.  
  837.          ((Component)this).repaint();
  838.  
  839.          try {
  840.             Thread.sleep((long)this.sdly);
  841.          } catch (InterruptedException var1) {
  842.          }
  843.       }
  844.    }
  845. }
  846.